﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Controls;
using System.Windows;

namespace Relay.UI.Controls.Docking.Primitives {
    internal abstract class DockOverlay : Control {
        #region Dependency Properties
        public static readonly DependencyProperty HitTestProperty = DependencyProperty.Register(
            "HitTest", typeof(DockOverlayHitTestResult), typeof(DockOverlay));
        #endregion

        #region Properties
        public DockOverlayHitTestResult HitTest {
            get { return (DockOverlayHitTestResult)GetValue(HitTestProperty); }
            set { SetValue(HitTestProperty, value); }
        }
        #endregion

        #region Protected Methods
        protected bool HitTestElement(FrameworkElement element, Point mousePos) {
            Point pos = element.PointFromScreen(mousePos);
            return (pos.X > 0 && pos.Y > 0 && pos.X < element.ActualWidth && pos.Y < element.ActualHeight);
        }
        #endregion
    }
}
